package com.osce.score.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.csce.domain.entity.score.ScoreExExamPlace;
import org.apache.ibatis.annotations.MapKey;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Map;

/**
 * 考试考场Mapper接口
 *
 * @author zzx
 * @since 2023-09-05
 */
@Repository
public interface ScoreExExamPlaceMapper extends BaseMapper<ScoreExExamPlace> {

    /**
     * 查询考试考场
     *
     * @param id 考试考场主键
     * @return 考试考场
     */
    ScoreExExamPlace selectScoreExExamPlaceById(Long id);

    Integer selectScoreExExamPlaceCountByExamId(Long examId);

    /**
     * 查询考试考场列表
     *
     * @param scoreExExamPlace 考试考场
     * @return 考试考场集合
     */
    List<ScoreExExamPlace> selectScoreExExamPlaceList(ScoreExExamPlace scoreExExamPlace);

    List<ScoreExExamPlace> selectScoreExExamPlaceListByExamId(Long examId);

    /**
     * 新增考试考场
     *
     * @param scoreExExamPlace 考试考场
     * @return 结果
     */
    int insertScoreExExamPlace(ScoreExExamPlace scoreExExamPlace);

    /**
     * 修改考试考场
     *
     * @param scoreExExamPlace 考试考场
     * @return 结果
     */
    int updateScoreExExamPlace(ScoreExExamPlace scoreExExamPlace);

    /**
     * 删除考试考场
     *
     * @param id 考试考场主键
     * @return 结果
     */
    int deleteScoreExExamPlaceById(Long id);

    /**
     * 批量删除考试考场
     *
     * @param ids 需要删除的数据主键集合
     * @return 结果
     */
    int deleteScoreExExamPlaceByIds(Long[] ids);

    int batchInsertScoreExExamPlace(List<ScoreExExamPlace> scoreExExamPlaces);

    int deleteScoreExExamPlaceByExamIds(Long[] ids);

    int deleteScoreExExamPlaceByExamId(Long id);

    @MapKey("id")
    Map<Long, ScoreExExamPlace> selectBasicExPlaceToMapByIds(Long[] ids);
}
